import { defineStore } from "pinia";


//defineStore两个参数:1模块名称 2对象包含state函数、getters和actions对象
export const useDemoStore = defineStore('demo',{
    state:()=>{
        return {
            name:"张三",
            age:14
        }
    },
    getters:{},
    actions:{
        changeName(newName){
            this.name = newName;
        }
    }
})